home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
os2
/
adaptor.zip
/
ADAPT.ZIP
/
adaptor
/
examples
/
purdue
/
prob04ol.fcm
< prev
next >
Wrap
Text File
|
1993-06-26
|
2KB
|
79 lines
PROGRAM PROB04
C
C PROBLEM 04
C
C REFERENCE: PROBLEMS TO TEST PARALLEL AND VECTOR LANGUAGES
C CSD-TR 516, COMPUTER SCIENCE, PURDUE UNIVERSITY
C JOHN R. RICE, MAY 1, 1985
C
C REVISED BY JOHN R. RICE AND J. JING, OCT. 1, 1990
C
C
C *************************************************
C * Adapted for FORTRAN D benchmarking *
C * by T. HAUPT (haupt@sccs.npac.syr.edu) *
C * *
C * Northeast Parallel Architectures Center *
C * at Syracuse University, Syracuse, NY, USA *
C *************************************************
C
C
C VERSION SIMD/CM2-1.00
C ==================================================
C
INCLUDE '/usr/include/cm/paris-configuration-fort.h'
INTEGER KASES,NK
PARAMETER (KASES=3)
INTEGER N(KASES)
cmf$ layout N(:serial)
DATA N /16384,65536,524288/
REAL X
DO 50 K = 1, KASES
CALL CM_TIMER_CLEAR(0)
CALL CM_TIMER_START(0)
DO MANY=1,25
NK=N(K)
CALL DOIT(NK,X)
ENDDO
CALL CM_TIMER_STOP(0)
PRINT *,'PROBLEM 4 WITH N =',NK
PRINT *,'GIVES X = ',X
CALL CM_TIMER_PRINT(0)
50 CONTINUE
STOP
END
SUBROUTINE DOIT(NK,X)
INTEGER NK
REAL X
REAL, ARRAY(NK) :: Y,Z
C Y=1.0/(1.0+[1:NK])
DO MANY=1,20
Y=MANY
Z=0
WHERE(Y.NE.0)
Z=1.0/Y
ENDWHERE
ENDDO
X=SUM(Z)
END